package com.youlu.campus.activity.entity;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.index.Indexed;
import org.springframework.data.mongodb.core.mapping.Document;

import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;

/**
 * 用户抽奖信息
 *
 * @Description: UserLotteryInfo
 * @Date 2025/7/31
 * @module UserLotteryInfo
 * @author: su
 */
@Data
@Document(collection = "user_lottery_info")
public class UserLotteryInfo {

    @Id
    private String id;

    @Indexed
    @NotNull(message = "用户ID不能为空")
    private String userId;

    @Indexed
    @NotNull(message = "活动ID不能为空")
    private String activityId;

    /**
     * 可抽奖次数
     */
    private Integer availableDraws = 0;

    /**
     * 已抽奖次数
     */
    private Integer drawnCount = 0;

    /**
     * 今日抽奖次数
     */
    private Integer todayCount = 0;


    /**
     * 最后一次抽奖时间
     */
    private LocalDateTime lastDrawTime;

}
